package com.gopay.webtest.handler;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.webtest.util.BaseSign;
import com.gopay.webtest.util.ReflectUtil;

/**
 * @Sign4BtHandler.java
 * @author gz
 * @2013-7-29 上午11:01:46  www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("Sign4BtRespHandler")
public class Sign4BtRespHandler extends BaseSign   {

	@Override
	public String execute(Object obj, List<String> signFields) throws Exception {
		if(signFields == null || signFields.size()==0)
			throw new Exception("组装加签明文失败，加签域失败");
		StringBuffer sb = new StringBuffer();
		for(String signField : signFields){
			sb.append(signField);
			sb.append("=[");
			sb.append(ReflectUtil.getFieldValue(obj, signField));
			sb.append("]");
		}
		return sb.toString();
	}

}
